package com.example.anpapi.entity.po.usermodel.User;

import com.baomidou.mybatisplus.annotation.*;
import com.example.anpapi.entity.po.usermodel.User.UserRole;
import com.example.anpapi.entity.po.usermodel.User.UserStatus;
import com.fasterxml.jackson.annotation.JsonFormat;

import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.time.LocalDateTime;

@TableName("users")
@Getter
@Setter
public class User implements Serializable{


        private static final long serialVersionUID = 1L;

        /**
         * 用户ID
         */
        @TableId(value = "id", type = IdType.AUTO)
        private Long id;

        /**
         * 用户名
         */
        @TableField("username")
        private String username;

        /**
         * 邮箱
         */
        @TableField("email")
        private String email;

        /**
         * 密码
         */
        @TableField("password")
        private String password;

        /**
         * 昵称
         */
        @TableField("nickname")
        private String nickname;

        /**
         * 头像URL
         */
        @TableField("avatar_url")
        private String avatarUrl;

        /**
         * 个人简介
         */
        @TableField("introduction")
        private String introduction;

        /**
         * 角色
         */
        @TableField("role")
        private UserRole role;

        /**
         * 状态
         */
        @TableField("status")
        private UserStatus status;

        /**
         * 用户等级
         */
        @TableField("level")
        private Integer level;

        /**
         * 经验值
         */
        @TableField("experience_points")
        private Integer experiencePoints;

        /**
         * 创建时间
         */
        @TableField(value = "created_time", fill = FieldFill.INSERT)
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        private LocalDateTime createdTime;

        /**
         * 更新时间
         */
        @TableField(value = "updated_time", fill = FieldFill.INSERT_UPDATE)
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        private LocalDateTime updatedTime;

        /**
         * 最后登录时间
         */
        @TableField("lastlogin_time")
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        private LocalDateTime lastloginTime;

}
